package com.hsylient.javase.draftpaper;

import com.alibaba.fastjson.JSON;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.Date;

public class FastJsonTest {

    public static void main(String[] args) {
        Dog dog = new Dog("hsylient", 11, new Date());
        String jsonString = JSON.toJSONString(dog);
        System.out.println(jsonString);
    }


    @Data
    @AllArgsConstructor
    public static class Dog {
        // 姓名
        private String name;
        // 年龄
        private Integer age;
        // 生日
        private Date birthday;
    }
}
